/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.qinyeit.serviceapp.entity.enums.StockInOutType;
import lombok.Builder;
import lombok.experimental.Tolerate;

import javax.persistence.*;

/**
 * ClassName: StockInOut <br/>
 * Function: 库存进出明细 <br/>
 * date: 2018-11-07 11:58:30 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="stock_in_outs")
public class StockInOut extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 原料id 
    @Column(name="material_id")
	private Long materialId = null;

	// 操作类型 
    @Column(name="type", length = 300)
	@Enumerated(EnumType.STRING)
	private StockInOutType type = null;

	// 操作数量 
    @Column(name="count",scale=2)
	private Double count = null;

	// 操作总金额 
    @Column(name="amount",scale=2)
	private Double amount = null;

	// 计算均价 
    @Column(name="cal_average")
	private Boolean calAverage = null;


    @Tolerate
	public StockInOut() {
		
	}
    @Tolerate
	public StockInOut(Long id){
    	super.setId(id);
    }
	


	/**
	 * 获取原料id
	 */
	public Long getMaterialId() {
		return this.materialId;
	}

    /**
     * 设置原料id
     */
	public StockInOut setMaterialId(Long materialId) {
		this.materialId = materialId;
		return this;
	}

	public StockInOutType getType() {
		return type;
	}

	public void setType(StockInOutType type) {
		this.type = type;
	}

	/**
	 * 获取操作数量
	 */
	public Double getCount() {
		return this.count;
	}

    /**
     * 设置操作数量
     */
	public StockInOut setCount(Double count) {
		this.count = count;
		return this;
	}

	/**
	 * 获取操作总金额
	 */
	public Double getAmount() {
		return this.amount;
	}

    /**
     * 设置操作总金额
     */
	public StockInOut setAmount(Double amount) {
		this.amount = amount;
		return this;
	}

	/**
	 * 获取计算均价
	 */
	public Boolean getCalAverage() {
		return this.calAverage;
	}

    /**
     * 设置计算均价
     */
	public StockInOut setCalAverage(Boolean calAverage) {
		this.calAverage = calAverage;
		return this;
	}

}
